package com.pf.rule.mapper.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.pf.common.constant.LogConverterKeyConstant;
import com.pf.common.constant.LogModuleCodeConstant;
import com.pf.log.annotation.LogBusinessId;
import com.pf.log.annotation.LogDateTimeFormat;
import com.pf.log.annotation.LogField;
import com.pf.log.annotation.converter.SimpleConverter;
import lombok.Data;

import java.util.Date;

/**
 * @author PanFei
 * @version 1.0.0
 * @createTime 2022/7/7 21:29
 */
@TableName(value = "rule_table")
@Data
public class RuleEntity extends BaseEntity {
    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 规则编码
     */
    @LogBusinessId(moduleCode = LogModuleCodeConstant.RULE_MODULE)
    private String ruleCode;

    /**
     * 规则名称
     */
    @LogField
    private String ruleName;

    /**
     * 规则类型
     */
    @LogField(alias = "ruleTypeDesc", converterKey = LogConverterKeyConstant.RULE_TYPE, converter = SimpleConverter.class)
    private String ruleType;

    /**
     * 生效日期
     */
    @LogField
    @LogDateTimeFormat
    private Date effectiveDate;

    /**
     * 规则描述
     */
    @LogField(splitRegx = ",")
    private String ruleDesc;
}
